﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;

namespace Proggy.Web.Cms.Membership
{
    /// <summary>
    /// Checks front-end requests for "lockdown" vs current user
    /// </summary>
    public class ProggyFrontEndAuthorizeAttribute : AuthorizeAttribute
    {
        protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext)
        {
            // AUTHORIZE BASED ON CURRENT USER / MODEL
            return true;
        }

        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            //base.HandleUnauthorizedRequest(filterContext);
            throw new HttpException(403, "Access denied");
        }
    }
}
